inherit CometCompo_evolution Logical_consistency

#___________________________________________________________________________________________________________________________________________
method CometCompo_evolution constructor {name descr args} {
 this inherited $name $descr
 this set_GDD_id CT_CometCompo_evolution

 set CFC ${objName}_CFC; CometCompo_evolution_CFC $CFC; this set_Common_FC $CFC

 set this(LM_FC) ${objName}_LM_FC
 CometCompo_evolution_LM_FC $this(LM_FC) $this(LM_FC) "The LM FC of $name"
   this Add_LM $this(LM_FC)
 set this(LM_LP) ${objName}_LM_LP
 CometCompo_evolution_LM_LP $this(LM_LP) $this(LM_LP) "The LM LP of $name"
   this Add_LM $this(LM_LP)
   
 eval "$objName configure $args"
 return $objName
}

#___________________________________________________________________________________________________________________________________________
method CometCompo_evolution dispose {} {this inherited}

#___________________________________________________________________________________________________________________________________________
Manage_CallbackList CometCompo_evolution [list dispose] begin

#___________________________________________________________________________________________________________________________________________
#___________________________________________________________________________________________________________________________________________
#___________________________________________________________________________________________________________________________________________
Methodes_set_LC CometCompo_evolution [P_L_methodes_set_CometCompo_evolution] {$this(FC)} {$this(L_LM)}
Methodes_get_LC CometCompo_evolution [P_L_methodes_get_CometCompo_evolution] {$this(FC)}

#___________________________________________________________________________________________________________________________________________
method CometCompo_evolution = {C} {
 this set_L_outputs      [$C get_L_outputs]
 this set_L_inputs       [$C get_L_inputs]
 this set_L_param        [$C get_L_param]
 this set_Core           [$C get_Core]
 this set_Ext_input      [$C get_Ext_input]
 this set_Ext_output     [$C get_Ext_output]
 this set_can_process    [$C get_can_process]
 this set_has_error      [$C get_has_error]
 this set_has_processed  [$C get_has_processed]
 this set_nb_max_process [$C get_nb_max_process]
 
 [this get_Common_FC] set_core_f_name [[$C get_Common_FC] get_core_f_name]
 
 this set_style_class    [$C get_style_class]
 foreach {var val} [$C get_L_MetaData] {this Add_MetaData $var $val}
}

Trace CometCompo_evolution =

#___________________________________________________________________________________________________________________________________________
Inject_code CometCompo_evolution Reset {
 foreach o [this get_L_outputs] {this set_Output_data [lindex $o 0] ""}
 foreach i [this get_L_inputs]  {this set_Input_data  [lindex $i 0] ""}
 this set_has_processed   0 
 this set_can_process     0 
 this set_has_error       0
 this set_nb_process      0
} {}

#___________________________________________________________________________________________________________________________________________
#___________________________________________________________________________________________________________________________________________
#___________________________________________________________________________________________________________________________________________
Manage_CallbackList CometCompo_evolution [list set_can_process set_has_processed] end

#___________________________________________________________________________________________________________________________________________
Inject_code CometCompo_evolution Serialize {
 this Reset_serialization
 set root_path [Root_of_CometDimitri]; set length_root_path [string length $root_path]
 set core_file [[this get_Common_FC] get_core_f_name]
 if {[string equal -length $length_root_path $core_file $root_path]} {set core_file [string range $core_file $length_root_path end]}
 
 this append_to_serialization "<CometCompo_evolution id=\"${prefix}_$objName\" name=\"[this get_name]\" nb_max_process=\"[this get_nb_max_process]\" MetaData=\"[this get_L_MetaData]\" core_f_name=\"$core_file\">\n"
} {
 this append_to_serialization "</CometCompo_evolution>\n"

 return [this get_serialization]
}
